\section{Comandos Básicos Unix}

\subsection{pwd}
\begin{enumerate}[a.]
  \item El directorio pasa a ser \textit{/usr/bin}
  \item El directorio pasa a ser \textit{/home/santiago}
  \item Porque asi funciona el comando \textbf{\textit{cd}}. Si no se especifica ningún directorio, entonces cd cambia el working directory al especificado por la variable de entorno HOME de la shell. (\textit{http://ss64.com/bash/cd.html})
\end{enumerate}

\subsection{cat}
\textbf{cat} /home/santiago/.profile

\begin{scriptsize}
\begin{verbatimtab}
  # ~/.profile: executed by the command interpreter for login shells.
  # This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
  # exists.
  # see /usr/share/doc/bash/examples/startup-files for examples.
  # the files are located in the bash-doc package.

  # the default umask is set in /etc/profile; for setting the umask
  # for ssh logins, install and configure the libpam-umask package.
  #umask 022

  # if running bash
  if [ -n "$BASH_VERSION" ]; then
      # include .bashrc if it exists
      if [ -f "$HOME/.bashrc" ]; then
	  . "$HOME/.bashrc"
      fi
  fi

  # set PATH so it includes user's private bin if it exists
  if [ -d "$HOME/bin" ] ; then
      PATH="$HOME/bin:$PATH"
  fi
\end{verbatimtab}
\end{scriptsize}

\subsection{find}
\textbf{find} / -name ``vmlinuz*''
\begin{itemize}
 \item /vmlinuz
  \item /boot/vmlinuz-2.6.24-24-virtual
\end{itemize}

\subsection{mkdir}
\textbf{mkdir} /home/santiago/tp

\subsection{cp}
\textbf{cp} /etc/passwd /home/santiago/tp

\subsection{chgrp}
Primero ejecutamos \textbf{groups} para ver a que grupos pertenece \textit{santiago}. Luego hicimos: \\ \textbf{chgrp} santiago /home/santiago/tp/passwd.

\subsection{chown}
\textbf{chown} santiago /home/santiago/tp/passwd 

\subsection{chmod}
\textbf{chmod} -rwxr-x--x /home/santiago/tp/passwd
\\Los permisos se dividen en tres grupos: owner-group-other, en ese orden.

\subsection{grep}
\begin{enumerate}[a.]
  \item \textbf{grep} "localhost" /etc/hosts

  \begin{verbatimtab}
  127.0.0.1   localhost
  ::1 ip6-localhost   ip6-loopback
  \end{verbatimtab}

  \item \textbf{grep} -R -I -s POSIX /etc/
  \begin{verbatimtab}
  /etc/init.d/glibc.sh:     echo WARNING: POSIX threads library NPTL requires kernel version
  /etc/security/limits.conf:\# - msgqueue - max memory used by POSIX message queues (bytes)
  \end{verbatimtab}
\end{enumerate}

\subsection{passwd}
\textbf{passwd}
\begin{verbatimtab}
  (current) UNIX password:
  Enter new UNIX password:
  Retype new UNIX password:
  passwd: password updated successfully
\end{verbatimtab}

\subsection{rm}
\textbf{rm} /home/usuario/tp/passwd

\subsection{ln}
\textbf{ln} /etc/passwd /tmp/contra1\\
\textbf{ln} /etc/passwd /tpm/contra2\\
\textbf{ls} -l /etc/passwd
\begin{verbatimtab}
  -rw-r--r-- 3 root root 939 2009-11-15 16:11 /etc/passwd
\end{verbatimtab}
\textbf{ln} -s /etc/passwd /tmp/contra3\\
\textbf{ls} -l /etc/passwd
\begin{verbatimtab}
  -rw-r--r-- 3 root root 939 2009-11-15 16:11 /etc/passwd
\end{verbatimtab}

\subsection{mount}
\textbf{mount} /dev/cdrom /media/cdrom
\begin{verbatimtab}
  cdromupgrade
  dists
  doc
  install
  isolinux
  md5sum.txt
  pics
  pool
  preseed
  README.diskdefines
  ubuntu
\end{verbatimtab}

\subsection{df}
\textbf{df} -h
\begin{verbatimtab}
  Filesystem            Size  Used Avail Use% Mounted on
  /dev/sda1             3.8G  376M  3.2G  11% /
  varrun                125M   28K  125M   1% /var/run
  varlock               125M     0  125M   0% /var/lock
  udev                  125M   40K  125M   1% /dev
  devshm                125M     0  125M   0% /dev/shm
  /dev/scd0             101M  101M     0 100% /media/cdrom0
\end{verbatimtab}

\subsection{ps}
Para realizar el siguiente punto instalamos las guest-additions de virtual box con el fin de poder 
compartir carpetas entre la máquina virtual y el host. Por eso es que los datos del punto anterior han cambiado (el espacio en disco) \\ \\
\textbf{ps} aux
\begin{scriptsize}
\begin{verbatimtab}
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.3  0.6   2844  1692 ?        Ss   17:24   0:01 /sbin/init
root         2  0.0  0.0      0     0 ?        S<   17:24   0:00 [kthreadd]
root         3  0.0  0.0      0     0 ?        S<   17:24   0:00 [migration/0]
root         4  0.0  0.0      0     0 ?        S<   17:24   0:00 [ksoftirqd/0]
root         5  0.0  0.0      0     0 ?        S<   17:24   0:00 [watchdog/0]
root         6  0.0  0.0      0     0 ?        S<   17:24   0:00 [events/0]
root         7  0.0  0.0      0     0 ?        S<   17:24   0:00 [khelper]
root        36  0.0  0.0      0     0 ?        S<   17:24   0:00 [kblockd/0]
root        39  0.0  0.0      0     0 ?        S<   17:24   0:00 [kacpid]
root        40  0.0  0.0      0     0 ?        S<   17:24   0:00 [kacpi_notify]
root        80  0.0  0.0      0     0 ?        S<   17:24   0:00 [kseriod]
root       115  0.0  0.0      0     0 ?        S    17:24   0:00 [pdflush]
root       116  0.0  0.0      0     0 ?        S    17:24   0:00 [pdflush]
root       117  0.0  0.0      0     0 ?        S<   17:24   0:00 [kswapd0]
root       158  0.0  0.0      0     0 ?        S<   17:24   0:00 [aio/0]
root      1240  0.0  0.0      0     0 ?        S<   17:25   0:00 [ata/0]
root      1244  0.0  0.0      0     0 ?        S<   17:25   0:00 [ata_aux]
root      1256  0.0  0.0      0     0 ?        S<   17:25   0:00 [scsi_eh_0]
root      1258  0.0  0.0      0     0 ?        S<   17:25   0:00 [scsi_eh_1]
root      2169  0.0  0.0      0     0 ?        D<   17:25   0:00 [kjournald]
root      2308  0.4  0.2   2268   724 ?        S<s  17:25   0:01 /sbin/udevd --daemon
root      2499  0.0  0.0      0     0 ?        S<   17:25   0:00 [kpsmoused]
dhcp      3440  0.0  0.2   2436   552 ?        S<s  17:25   0:00 dhclient3 -e IF_METRIC=100 -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0
root      3757  0.0  0.1   1716   504 tty4     Ss+  17:25   0:00 /sbin/getty 38400 tty4
root      3758  0.0  0.1   1716   508 tty5     Ss+  17:25   0:00 /sbin/getty 38400 tty5
root      3763  0.0  0.2   1716   512 tty2     Ss+  17:25   0:00 /sbin/getty 38400 tty2
root      3766  0.0  0.1   1716   508 tty3     Ss+  17:25   0:00 /sbin/getty 38400 tty3
root      3768  0.0  0.1   1716   508 tty6     Ss+  17:25   0:00 /sbin/getty 38400 tty6
root      3808  0.0  0.2   3032   680 ?        Sl   17:25   0:00 /usr/sbin/vboxadd-service
syslog    3841  0.0  0.2   1936   648 ?        Ss   17:25   0:00 /sbin/syslogd -u syslog
root      3860  0.0  0.2   1872   532 ?        S    17:25   0:00 /bin/dd bs 1 if /proc/kmsg of /var/run/klogd/kmsg
klog      3862  0.0  0.7   3028  1868 ?        Ss   17:25   0:00 /sbin/klogd -P /var/run/klogd/kmsg
root      3881  0.0  0.4   2568  1208 tty1     Ss   17:25   0:00 /bin/login --         
santiago  3882  0.0  0.8   4652  2048 tty1     S    17:25   0:00 -bash
santiago  3930  0.0  0.3   2644  1004 tty1     R+   17:31   0:00 ps aux
\end{verbatimtab}
\end{scriptsize}
Vemos que hay solo dos procesos que pertencen al usuario. El resto son de sistema.

\subsection{uptime}
\begin{verbatimtab} 
  17:36:41 up 11 min,  1 user,  load average: 0.00, 0.04, 0.06
\end{verbatimtab}

\subsection{uname}
\textbf{uname} -a
\begin{verbatimtab}
  Linux ubuntu 2.6.24-24-virtual #1 SMP Tue Jul 7 20:55:36 UTC 2009 i686 GNU/Linux
\end{verbatimtab}
